<div class="top-fixed">
    {{#if_eq page 'user_finances'}}
        <div class="navbar" style="max-width: 640px;margin: auto;">
            <div class="navbar-inner">
                <div class="left">
                    <a href="javascript:history.back();" class="">
                        <i class="fa fa-angle-left" style="font-size: 30px;"></i>
                    </a>
                </div>
                <div class="center">{{or user.nickname user.tel}}收支明细</div>
                <div class="right">
                    <a href="/user_withdraws?user_id={{user.id}}" class="blue">提现记录</a>
                </div>
            </div>
        </div>
        <input type="hidden" id="user_id" value="{{user_id}}">
    {{^}}
        <div class="table bgf bb tc fs14 order_nav" style="max-width: 640px;margin: auto;">
            <a href="/finances" class="table-cell active">
                <span class="hint-num">收支明细</span>
            </a>
            <a href="/withdraws" class="table-cell">
                <span class="hint-num">提现记录</span>
            </a>
        </div>
    {{/if_eq}}
</div>
<section class="main" style="max-width: 640px;margin: auto;">
    <div id="agency_frozen" class="table index-nav fs12 tc" style="display: none;">
        <a href="javascript:;" class="table-cell  br">
            <p id="frozen_agency_amount" class="fs18 red bold">0/0</p>
            <p>冻结代理收入(元/个)</p>
        </a>
        <a href="javascript:;" class="table-cell  br">
            <p id="frozen_inviter_agency_amount" class="fs18 blue bold">0/0</p>
            <p>冻结下级收入(元/个)</p>
        </a>
    </div>
    {{#if finances}}
        <ul class="list-wrapper fs13">
            {{#each finances}}
                <li class="flex-box flex-between bgf bb">
                    <div class="p10">
                        <p class="fs14 col0">{{operation_dict.text}}{{#if order_id}}_{{order_id}}{{/if}}
                            {{#if note}}「{{note}}」{{/if}}
                        </p>
                        {{#if_eq ../page 'user_finances'}}
                            {{#if_eq operation 'AgencySettle'}}
                                <p><a href="/partner_orders?agency_settle_id={{order_id}}" class="blue ">订单明细</a></p>
                            {{/if_eq}}
                            {{#if_eq operation 'InviterAgencySettle'}}
                                <p><a href="/partner_orders?agency_settle_id={{order_id}}" class="blue ">订单明细</a></p>
                            {{/if_eq}}
                        {{/if_eq}}
                        <p class="mt5 col9">{{format_datetime created_at}}</p>
                    </div>
                    <div class="p10">
                        {{#if_eq type 'In'}}
                            <span class="fs20 red">{{amount}}</span>
                        {{/if_eq}}
                        {{#if_eq type 'Out'}}
                            <span class="fs20 red">-{{amount}}</span>
                        {{/if_eq}}
                    </div>
                </li>
            {{/each}}
        </ul>

        <div class="loadmore-wrapper loadmore" style="margin-bottom: 30px;">
            {{#if loadmore}}
                <div class="weui-infinite-scroll">
                    <div class="infinite-preloader"></div>
                    正在加载...
                </div>
            {{/if}}
        </div>
    {{^}}
        <div class="tc nothing">
            <i><img src="images/default-none-order.png" alt="" class="imgm"></i>
            <span class="mt10 fs14 col9">您还没有收支记录！</span>
        </div>
    {{/if}}
</section>

<a href="/user_center" class="fixed-icon back-user-center">
    <img src="images/default-fixed-icon-user.png" alt="" class="block">
</a>